<template>
    <div class="sum" style="width: 100%;height: 100%;overflow-x:auto;overflow-y:auto;">
      <a-row class="all-row" style="width: 100%; height: 100%">
        <a-col :span="16" style="height: 96%;margin-top: 1%;box-shadow: 1.5px 1.5px 2px #aaaaaa;margin-left: 1%;border: 0.5px solid rgba(231, 231, 231, 0.486);border-radius: 3px;">
          <div style="height: 3%;width: 100%;background-color: #D7D7D7">输入参数</div>
          <div style="width: 100%;height: 97%;display: flex">
            <div style="height: 97%;width: 48%;margin-left:1%;margin-top:1%;box-shadow: 1.5px 1.5px 2px #aaaaaa;border: 0.5px solid rgba(231, 231, 231, 0.486);border-radius: 3px;">
              <div style="height: 5%;width: 100%">齿轮基本参数</div>
              <div style="height: 5%;width: 100%;display: flex">
                <div style="width: 50%"></div>
                <div style="width: 50%;display: flex;text-align: center">
                  <div style="width: 25%">小轮</div>
                  <div style="width: 20%;margin-left: 5%">大轮</div>
                </div>
              </div>
              <div style="display: flex;height: 90%;width: 100%">
                <div style="height: 100%;width: 35%">
                  <ul class="left_text" style="text-align: right">
                    <li>法向模数(mm)</li>
                    <li>齿数</li>
                    <li>法向压力角(°)</li>
                    <li>螺旋角(°)</li>
                    <li>中心距(mm)</li>
                    <li>法向变位系数</li>
                    <li>齿宽（mm）</li>
                    <li>齿顶高系数</li>
                    <li>顶隙系数</li>
                    <li>齿向倒角高度(直径)(mm)</li>
                    <li>齿顶削减量(直径)(mm)</li>
                    <li>齿面粗糙度Ra(um)</li>
                    <li>轮缘厚度系数</li>
                    <li>辐板厚度(mm)</li>
                    <li>齿顶修缘量(um)</li>
                    <li>齿轮类型</li>
                    <li>主动轮</li>
                    <li>精度等级</li>
                    <li>齿面跑合状况</li>
                  </ul>
                </div>
                <div style="height: 100%;width: 60%;margin-left: 5%">
                  <ul class="left_text">
                    <li><input v-model="from.normal_module" type="text"/></li>
                    <li>
                      <div class="input_1">
                        <input v-model="from.z_p" type="text"/>
                        <input v-model="from.z_w" type="text"/>
                      </div>
                    </li>
                    <li><input v-model="from.press_angle" type="text"/></li>
                    <li><input v-model="from.helix_angle" type="text"/></li>
                    <li><input v-model="from.work_center" type="text"/></li>
                    <li>
                      <div class="input_1">
                        <input v-model="from.z_w" type="text"/>
                        <div style="width: 50%;text-align: center">{{ans.normal_modi_factor_w}}</div>
                      </div>
                    </li>
                    <li><input v-model="from.face" type="text"/></li>
                    <li>
                      <div class="input_1">
                        <input v-model="from.ad_factor_p" type="text"/>
                        <input v-model="from.ad_factor_w" type="text"/>
                      </div>
                    </li>

                    <li><div class="input_1">
                      <input v-model="from.tip_factor_p" type="text"/>
                      <input v-model="from.tip_factor_w" type="text"/>
                    </div></li>
                    <li><div class="input_1">
                      <input v-model="from.chamfer_dia_p" type="text" />
                      <input v-model="from.chamfer_dia_w" type="text"/>
                    </div></li>
                    <li><div class="input_1">
                      <input v-model="from.ad_cut_dia_p" type="text"/>
                      <input v-model="from.ad_cut_dia_w" type="text"/>
                    </div></li>
                    <li><div class="input_1">
                      <input v-model="from.Ra_flank_p" type="text"/>
                      <input type="text" v-model="from.Ra_flank_w"/>
                    </div></li>
                    <li><div class="input_1">
                      <input v-model="from.SR_p" type="text"/>
                      <input v-model="from.SR_w" type="text"/>
                    </div></li>
                    <li><div class="input_1">
                      <input v-model="from.web_thickness_p" type="text"/>
                      <input v-model="from.web_thickness_w" type="text"/>
                    </div></li>
                    <li><div class="input_1">
                      <input v-model="from.Ca1" type="text"/>
                      <input v-model="from.Ca2" type="text"/>
                    </div></li>

                    <li>
                      <select v-model="from.gear_type">
                        <option value="1">外啮合</option>
                        <option value="2">内啮合</option>
                      </select>
                    </li>
                    <li>
                      <select v-model="from.driver">
                        <option value="1">小轮</option>
                        <option value="2">大轮</option>
                      </select>
                    </li>
                    <li>
                      <select v-model="from.quality_grade_type">
                        <option value="1">6级及以上</option>
                        <option value="2">6级以下</option>
                      </select>
                    </li>
                    <li>
                      <select v-model="from.runin_grade">
                        <option value="1">充分跑合</option>
                        <option value="2">新加工</option>
                      </select>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
            <div style="height: 97%;width: 48%;margin-top:1%;box-shadow: 1.5px 1.5px 2px #aaaaaa;border: 0.5px solid rgba(231, 231, 231, 0.486);border-radius: 3px;margin-left: 2%">
              <div style="height: 30%;width: 100%;border: 1px solid #333333;padding: 2px;border-radius: 8px">
                <div style="height: 10%;width: 100%">齿轮材料参数</div>
                <div style="height: 10%;width: 100%;display: flex">
                  <div style="height:100%;width: 50%"></div>
                  <div style="height:100%;width: 50%;display: flex">
                    <div style="width: 50%;text-align: center">小轮</div>
                    <div style="width: 50%;margin-left: 5%">大轮</div>
                  </div>
                </div>
                <div style="height: 80%;width: 100%;display: flex">
                  <div style="height: 100%;width: 45%">
                    <ul class="middle_top_text" style="text-align: right">
                      <li>弹性模量(MPa)</li>
                      <li>泊松比</li>
                      <li>热导率(N/(s.K))</li>
                      <li>单位体积比热容(N/(mm2.K))</li>
                    </ul>
                  </div>
                  <div style="height: 100%;width: 50%;margin-left: 5%">
                    <ul class="middle_top_text">
                      <li>
                        <div class="input_1">
                          <input v-model="from.E_p" type="text" /><input v-model="from.E_w" type="text"/>
                        </div>
                      </li>
                      <li>
                        <div class="input_1">
                          <input v-model="from.possion_p" type="text"/><input v-model="from.possion_w" type="text" />
                        </div>
                      </li>
                      <li>
                        <div class="input_1">
                          <input v-model="from.lambda_M1" type="text"/><input v-model="from.lambda_M2" type="text"/>
                        </div>
                      </li>
                      <li>
                        <div class="input_1">
                          <input v-model="from.c_v1" type="text" /><input v-model="from.c_v2" type="text"/>
                        </div>
                      </li>
                    </ul>
                  </div>
                </div>
              </div>
              <div style="height: 29%;width: 100%;border: 1px solid #333333;padding: 2px;border-radius: 8px;margin-top: 2px;margin-bottom: 2px">
                <div style="height: 5%;width: 100%;">载荷参数</div>
                <div style="height: 95%;width: 100%;display: flex">
                  <div style="height: 100%;width: 45%">
                    <ul class="middle_middle_text" style="text-align: right">
                      <li>小轮扭矩(Nmm)</li>
                      <li>小轮转速(r/min)</li>
                      <li>使用系数</li>
                      <li>动载系数</li>
                      <li>胶合(接触)齿向载荷分布系数</li>
                      <li>胶合(接触)齿间载荷分布系数</li>
                    </ul>
                  </div>
                  <div style="height: 100%;width: 50%;margin-left: 5%">
                    <ul class="middle_middle_text">
                      <li><input v-model="from.torque_p" type="text" /></li>
                      <li><input v-model="from.speed_p" type="text" /></li>
                      <li><input v-model="from.K_A" type="text" /></li>
                      <li><input v-model="from.K_V" type="text" /></li>
                      <li><input v-model="from.K_Hbeta" type="text" /></li>
                      <li><input v-model="from.K_Halpha" type="text" /></li>
                    </ul>
                  </div>
                </div>
              </div>
              <div style="height: 40%;width: 100%;border: 1px solid #333333;padding: 2px;border-radius: 8px;">
                <div style="height: 5%;width: 100%;">润滑与其他参数</div>
                <div style="height: 95%;width: 100%;display: flex">
                  <div style="height: 100%;width: 45%">
                    <ul class="middle_buttom_text" style="text-align: right">
                      <li>润滑方式</li>
                      <li>润滑剂类型</li>
                      <li>润滑剂牌号</li>
                      <li>40℃运动粘度(mm2/s)</li>
                      <li>100℃运动粘度(mm2/s)</li>
                      <li>润滑剂密度 (kg/m3)</li>
                      <li>油池/喷油温度(℃)</li>
                      <li>FZG试验载荷级</li>
                      <li>焊合系数</li>
                    </ul>
                  </div>
                  <div style="height: 100%;width: 50%;margin-left: 5%">
                    <ul class="middle_buttom_text">
                      <li>
                        <select v-model="from.lubrication_type">
                          <option value="1">喷油润滑</option>
                          <option value="2">油浴润滑</option>
                          <option value="3">齿轮浸没在油中</option>
                        </select>
                      </li>
                      <li>
                        <select v-model="from.lubricant" >
                          <option value="1">矿物油</option>
                          <option value="2">聚alpha烯族烃</option>
                          <option value="3">非水溶性聚乙二醇</option>
                          <option value="4">水溶性聚乙二醇</option>
                          <option value="5">牵引液体</option>
                          <option value="6">磷酸酯</option>
                        </select>
                      </li>
                      <li>
                        <select v-model="from.lubricant_ISOVG">
                          <option value="1">自定义</option>
                          <option value="2">22</option>
                          <option value="3">32</option>
                          <option value="4">46</option>
                          <option value="5">48</option>
                          <option value="6">100</option>
                          <option value="7">150</option>
                          <option value="8">220</option>
                          <option value="9">320</option>
                          <option value="10">460</option>
                          <option value="11">480</option>
                          <option value="12">1000</option>
                          <option value="12">1500</option>
                        </select>
                      </li>
                      <div >
                        <div >
                          <li><input v-show="from.lubricant_ISOVG==1" v-model="from.v_40" type="text" /></li>
                          <li><input v-show="from.lubricant_ISOVG==1" v-model="from.v_100" type="text" /></li>
                        </div>
                        <div style="width:80%;text-align: center">
                          <li v-show="from.lubricant_ISOVG!=1">{{ans.v_40}}</li>
                          <li v-show="from.lubricant_ISOVG!=1">{{ans.v_100}}</li>
                        </div>
                      </div>
                      <li><input v-model="from.Theta_oil" type="text" /></li>
                      <li><input v-model="from.oil_density" type="text" /></li>
                      <li><input v-model="from.FZG" type="text" /></li>
                      <li><input v-model="from.X_W" type="text" /></li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </a-col>
        <a-col :span="6" style="height: 96%;margin-top: 1%;box-shadow: 1.5px 1.5px 2px #aaaaaa;margin-left: 1%;border: 0.5px solid rgba(231, 231, 231, 0.486);border-radius: 3px;">
          <div class="right">
            <div class="input_upright">
            <div>
              <strong><label class="title2">输出参数</label></strong>
            </div>
            <div class="right_top">
              <div style="display: flex;margin-left: 17%;margin-top: 10%;height: 92%">
                <div style="text-align: right;margin-right: 20%;">
                  <ul style="height: 100%;width: 100%">
                    <li>轮齿本体温度(℃)</li>
                    <li>平均闪温(℃)</li>
                    <li>积分接触温度(℃)</li>
                    <li>润滑系数</li>
                    <li>粗糙度系数</li>
                    <li>平均摩擦系数</li>
                    <li>单位轮齿载荷(N/mm)</li>
                    <li>跑合系数</li>
                    <li>热闪系数</li>
                    <li>压力角系数</li>
                    <li>小轮齿顶几何系数</li>
                    <li>啮入系数</li>
                    <li>齿顶修缘系数</li>
                    <li>重合度系数</li>
                    <li>积分胶合温度(℃)</li>
                    <li>积分胶合安全系数</li>
                  </ul>
                </div>

                <div>
                  <ul>
                    <li>{{ans.Theta_MC}}</li>
                    <li>{{ans.Theta_flaint}}</li>
                    <li>{{ans.Theta_int}}</li>
                    <li>{{ans.X_L}}</li>

                    <li>{{ans.X_R}}</li>
                    <li>{{ans.u_mc}}</li>
                    <li>{{ans.specific_load}}</li>
                    <li>{{ans.X_E}}</li>

                    <li>{{ans.X_M}}</li>
                    <li>{{ans.X_alpha_betaA}}</li>
                    <li>{{ans.X_BE}}</li>
                    <li>{{ans.X_Q}}</li>

                    <li>{{ans.X_Ca}}</li>
                    <li>{{ans.X_contact_ratio}}</li>
                    <li>{{ans.Theta_intS}}</li>
                    <li>{{ans.S_intS}}</li>
                  </ul>
                </div>

              </div>
            </div>
          </div>
            <div style="height: 5%;text-align: right">
            <button style="height: 80%;width: 20%" @click="geta">计算</button>
           </div>
          </div>
        </a-col>
      </a-row>
    </div>
</template>

<script>
import {scuffing_integral_temperature} from "@/api/file";
export default {
  created() {
    document.title='齿轮胶合计算（积温）'
  },
  name:"scuffing_integral_temperature",
  data(){
    return{
      from:{
        normal_module: 5,
        z_p: 35,
        z_w: 121,
        press_angle: 20,
        helix_angle: 10,
        work_center: 400,
        normal_modi_factor_p: 0,
        face: 110,
        ad_factor_p: 1,
        ad_factor_w: 1,
        tip_factor_p: 0.25,
        tip_factor_w: 0.25,
        chamfer_dia_p: 0,
        chamfer_dia_w: 0,
        ad_cut_dia_p: 0,
        ad_cut_dia_w: 0,
        Ra_flank_p: 1.6,
        Ra_flank_w: 1.6,
        SR_p: 3.5,
        SR_w: 3.5,
        web_thickness_p: 110,
        web_thickness_w: 110,
        Ca1: 0,
        Ca2: 0,
        gear_type: 1,
        driver: 1,
        quality_grade_type: 1,
        runin_grade: 1,
        E_p: 206000,
        E_w: 206000,
        possion_p: 0.3,
        possion_w: 0.3,
        lambda_M1: 50,
        lambda_M2: 50,
        c_v1: 3.8,
        c_v2: 3.8,
        torque_p: 2000000,
        speed_p: 1000,
        K_A: 1,
        K_V: 1.1,
        K_Hbeta: 1.3,
        K_Halpha: 1.05,
        lubrication_type: 1,
        lubricant:1,
        lubricant_ISOVG: 2,
        Theta_oil: 60,
        oil_density: 850,
        FZG: 12,
        X_W: 1,
        v_40:46,
        v_100:6.72
      },
      ans:{
        X_L:"Text",
        X_R:"Text",
        u_mc:"Text",
        X_M:"Text",
        X_BE:"Text",
        X_alpha_betaA:"Text",
        specific_load:"Text",
        X_E:"Text",
        X_Q:"Text",
        X_Ca:"Text",
        X_contact_ratio:"Text",
        Theta_MC:"Text",
        Theta_flaint:"Text",
        S_intS:"Text",
        Theta_intS:"Text",
        Theta_int:"Text",
        normal_modi_factor_w:"Text",
        v_40:"Text",
        v_100:"Text"
      }
    };
  },
  methods:{
    geta(){
      scuffing_integral_temperature(this.from)
          .then(res =>{
            console.log(res);
            this.ans.X_L=res[6];
            this.ans.X_R=res[7];
            this.ans.u_mc=res[8];
            this.ans.X_M=res[11];
            this.ans.X_BE=res[13];

            this.ans.X_alpha_betaA=res[12];
            this.ans.specific_load=res[9];

            this.ans.X_E=res[10];
            this.ans.X_Q=res[14];
            this.ans.X_Ca=res[15];

            this.ans.X_contact_ratio=res[16];
            this.ans.Theta_MC=res[3];
            this.ans.Theta_flaint=res[4];

            this.ans.S_intS=res[18];
            this.ans.Theta_intS=res[17];
            this.ans.Theta_int=res[5];
            this.ans.normal_modi_factor_w=res[0];
            this.ans.v_40=res[1];
            this.ans.v_100=res[2];
      /*      if(res.code===200){
              console.log(res.data);
              this.ans=res.data.anslist;
            }*/
          })
          .catch(error =>{
            console.log(error);
          });
    },

  }
}
</script>

<style scoped>

.right{
  height: 100%;
  width: 100%
}
.left_text
{
  height: 100%;
  width: 100%;
}
.left_text li
{
  height: 5%;
  width: 100%;
}
.left_text input
{
  height: 90%;
  width: 80%;
}
.left_text select
{
  height:90%;
  width: 80%;
}
.middle_top_text
{
  height: 100%;
  width: 100%;
}
.middle_top_text li
{
  height: 25%;
  width: 100%;
}
.middle_top_text input
{
  height: 80%;
  width: 80%;
}
.middle_middle_text
{
  height: 100%;
  width: 100%;
}
.middle_middle_text li
{
  height: 15%;
  width: 100%;
}
.middle_middle_text input
{
  height: 90%;
  width: 80%;
}
.middle_buttom_text
{
  height: 100%;
  width: 100%;
}
.middle_buttom_text li
{
  height: 10%;
  width: 100%;
}
.middle_buttom_text input,.middle_buttom_text select
{
  height: 90%;
  width: 80%;
}

.input_upright{
  margin-left: 8px;
  height: 95%;
  width: 100%;
}

.input_1
{
  height: 100%;
  width: 80%;
  display: flex;
}

.input_1 input
{
  width: 50%;
}
.title2{
  padding-top: 5.5px;
  padding-bottom: 4px;
  padding-left: 15px;
  padding-right: 78.4%;
  border-radius: 5px;
  background-color: rgba(215, 215, 215, 1);
  font-size: 18px;
}

.left_ul li
{
  margin-top: 3px;
}

</style>